package com.nan.translation.respository;

import com.nan.translation.model.User;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;

@Repository
@Transactional
public interface UserRepository extends CrudRepository<User, Integer> {
    //@Modifying
    //通过name查询
    @Query("select user from User user where user.username = ?1")
    User findUserByName(String name);
}

